package priv.pattern.compositemode.service.impl;

import priv.pattern.compositemode.service.BaseShape;

import java.awt.*;

/*
 * 作者：m鹏h
 * 时间；2024/8/5 17:59
 * 描述：点
 **/
public class Dot extends BaseShape {
 private final int DOT_SIZE = 3;

 public Dot(int x, int y, Color color) {
  super(x, y, color);
 }

 @Override
 public int getWidth() {
  return DOT_SIZE;
 }

 @Override
 public int getHeight() {
  return DOT_SIZE;
 }

 @Override
 public void paint(Graphics graphics) {
  super.paint(graphics);
  graphics.fillRect(x - 1, y - 1, getWidth(), getHeight());
 }
}
